Today bar codes are ubiquitously found on or associated with objects of various types, such as the packaging of retail, wholesale, and inventory goods; retail product presentation fixtures (e.g., shelves); goods undergoing manufacturing; personal or company assets; and documents. By encoding information, a bar code typically serves as an identifier of an object, whether the identification be to a class of objects (e.g., oranges) or a unique item (e.g., U.S. Pat. No. 6,012,639). Bar codes consist of alternating bars (i.e., relatively dark areas) and spaces (i.e., relatively light areas). The widths of the bars and spaces are often set to encode a desired information sequence, as the pattern of bars and spaces represents a string of binary ones and zeros, wherein the width of any particular bar or space is an integer multiple of a specified minimum width, which is called a “module” or “unit.” Thus, to decode the information, a bar code reader must be able to reliably discern the locations of edges demarking adjacent bars and spaces from one another. The leading edge of a bar (i.e., a light-to-dark transition) is commonly denoted as an STV (set video), and the trailing edge of a bar (i.e., a dark-to-light transition) is commonly denoted as an RTV (reset video).
Optical scanning equipment can be utilized to generate an electrical signal indicative of the positions of bars and spaces in a bar code. A brief description of the optical scanning equipment that generates that signal is provided here, but a more complete introduction to the optical scanning of bar codes can be found in the background section of the above-noted U.S. Pat. No. 6,012,639, the entirety of which is incorporated by reference herein. Typical optical scanning equipment comprises one or more illumination sources and one or more photodetectors. The illumination source may be a laser producing a focused beam spot on a small area of the bar code. As the laser spot and the bar code move relative to each other, such that the spot is scanned across the bar code, a photodetector detects the laser light reflected off the bar code and produces an electrical signal whose magnitude is related to the optical power of the reflected signal. Thus, as the spot scans across the bar code, the photodetector generates an electrical signal whose variations over time at least roughly correlate to the spatial pattern of bars and spaces in the bar code. Alternatively, the illumination source may be diffuse across the entire bar code, and the bar code may be imaged using a charge-coupled device (CCD) camera or a CMOS (complementary metal-oxide-semiconductor) imager, either of which forms an electronic image of the bar code. That electronic image can be sampled in the forward direction of the bar code to generate a virtual scan line signal, which is like the scan line signal generated with a scanning laser spot. In any event, the result is an electronic scan line signal, which, at least ideally, somehow relates to the spatial positions of the bars and spaces in the bar code. The next step is to process that signal to determine with some reliability where the edges (STVs and RTVs) lie.
A conventional edge detection system typically processes a scan line signal using a gated peak detection scheme. In general functional terms, such a system operates by forming the first and second derivatives of the scan line signal and by detecting peaks of the first derivative, which ideally represent optical edges. To find the peaks of the first derivative, such a system detects the zero crossings of the second derivative. The magnitude of the first derivative is also compared to a threshold in order to prevent the output of low contrast or false edges.
However, a scan line signal is seldom a perfect representation of a bar code for a variety of reasons. For example, the scan line signal is usually corrupted by noise, which is amplified by differentiation. Noise can be attributable to the optical scanning equipment, the laser beam, poor bar code printing quality, poor substrate quality or roughness, inconsistent bar or space color, modulated lighting effects, etc. Furthermore, a scan line signal is often corrupted by inter-symbol interference (ISI), which can result from the laser spot size being large compared to the unit width. Additionally, variations in the depth of field (i.e., the distance between the bar code and the bar code reader) can induce variations in the laser beam spot size and thus affect the amount of ISI in the scan line signal.
Bar codes are just one example of the many types of optical codes in use today. In general, optical codes encode useful, optically-readable information about the items to which they are attached or otherwise associated. While bar codes generally encode information across one dimension, higher-dimensional optical codes are also possible, such as, two-dimensional matrix codes (e.g., MaxiCode) or stacked codes (e.g., PDF 417). Decoding optical codes in general poses the same challenges, such as noise and ISI, posed by bar codes in particular.